import java.util.Scanner;
public class Main {
	public static void main(String args[]) {
		Scanner input = new Scanner(System.in);
		int[] a = new int[10];
		for(int i=0;i<a.length;i++) {
			a[i] = input.nextInt();
		}
		int chang = a.length;
		int max = a[0];
		for(int i=0;i<a.length;i++)
		{
			if(a[i]>max)   
				max=a[i];
		}
		int x = 0;
		for(int i=0;i<a.length;i++)
		{
			if(max==a[i])   
			x = i;
		}
		
		int f ;
		f = a[0];
		a[0] = a[x];
		a[x] = f;
		
		for(int i =0; i<a.length;i++) {
			System.out.printf("%4d", a[i]);
		}
		System.out.println();
		System.out.print("max="+max+","+"weizhi="+x);
	}

}